package com.helper.easyHelper.common.entity;


/**
 * @author 狠穿
 * @version 1.0.0
 * @date 2023/1/29
 */
public class Column {
    private String dbName;
    private String javaName;
    private String dbType;
    private String javaType;
    private Boolean nullable = true;
    private Boolean isPrimaryKey = false;
    private String defaultValue ;
    private String comment;

    public static String fromType(String dbType){
       if(dbType.contains("char") || dbType.contains("varchar")){
           return "String";
       }else{
           return "Integer";
       }
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getJavaName() {
        return javaName;
    }

    public void setJavaName(String javaName) {
        this.javaName = javaName;
    }

    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public Boolean getNullable() {
        return nullable;
    }

    public void setNullable(Boolean nullable) {
        this.nullable = nullable;
    }

    public Boolean getPrimaryKey() {
        return isPrimaryKey;
    }

    public void setPrimaryKey(Boolean primaryKey) {
        isPrimaryKey = primaryKey;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}
